/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * ServidorIniciado.java
 *
 * Created on 05/07/2012, 17:39:14
 */

package principal;

import java.awt.Font;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.awt.Graphics;
import java.awt.image.BufferStrategy;
import java.awt.Graphics2D;
import java.lang.reflect.*;
import Obrero.Obrero;
import cliente.Cliente;
import servidor1.Servidor;

/**
 *
 * @author Nico
 */

public final class ServidorIniciado extends javax.swing.JPanel {

    char[][] sopa={{'N','C','A','H','P','F','E','L','I','P','E','S','O','M','C','P','A','P','E','O','U','J','I','L','A','N','E','V','I','O'},
                   {'V','A','B','A','S','A','E','K','J','I','N','E','S','A','S','A','N','B','P','X','A','C','N','A','U','J','V','A','N','E'},
                   {'A','A','J','O','H','A','P','F','Z','A','Z','A','R','E','K','U','F','I','A','T','E','A','O','N','I','A','J','E','R','A'},
			    {'T','R','O','S','A','O','Z','A','F','E','N','L','C','A','R','M','E','N','P','I','L','R','K','A','E','N','A','U','I','S'},
			    {'R','P','E','U','N','A','U','J','A','P','O','F','A','E','R','I','A','S','A','A','D','L','L','N','P','E','E','O','C','O'},
			    {'A','U','J','N','A','A','F','O','J','S','U','E','J','A','G','A','L','D','A','F','P','O','A','U','I','N','I','S','O','U'},
			    {'M','E','T','U','A','L','D','A','O','J','I','L','P','D','P','A','L','P','M','I','U','S','U','L','L','A','E','O','L','A'},
			    {'E','K','A','C','A','R','L','O','S','A','U','I','A','C','A','O','A','J','U','A','N','I','R','A','E','N','P','A','E','G'},
			    {'O','S','J','K','A','N','I','I','E','U','P','L','A','U','R','A','I','R','E','B','A','N','O','C','F','O','T','E','B','A'},
			    {'K','A','L','S','S','E','N','I','D','S','A','R','E','Ã','O','A','R','U','A','L','P','A','S','A','E','J','U','A','N','S'},
			    {'N','A','B','A','F','K','A','G','P','E','M','M','P','I','J','A','H','J','I','N','E','S','A','U','O','S','E','N','F','O'},
			    {'U','J','I','A','M','E','A','A','I','E','P','D','T','A','I','F','O','L','L','A','D','I','A','P','L','V','A','J','H','R'},
			    {'D','A','U','N','F','O','L','A','N','E','H','A','G','U','E','P','I','L','E','F','L','S','R','N','I','R','E','N','Z','I'},
			    {'E','L','F','A','E','P','O','I','J','U','A','N','E','P','S','E','N','I','N','E','I','P','L','O','N','E','M','R','A','C'},
			    {'O','A','Y','E','N','S','E','N','P','M','A','A','P','E','E','R','A','D','F','O','R','A','O','M','P','S','S','C','S','O'},
			    {'R','S','O','O','A','A','U','J','A','E','E','P','H','Z','A','L','N','A','I','S','U','D','S','A','N','A','R','E','E','G'},
			    {'A','N','A','U','J','A','Z','A','P','A','P','A','N','A','F','A','U','I','U','J','U','A','I','N','E','U','E','N','I','L'},
			    {'E','H','Ã','E','J','U','A','N','S','A','A','R','E','N','C','A','R','L','O','S','D','E','P','T','A','M','P','I','A','R'},
			    {'A','S','D','E','J','U','A','N','P','A','A','T','R','A','M','E','A','A','Z','A','P','A','R','L','N','A','T','A','E','R'},
			    {'B','O','N','E','I','N','E','S','G','A','A','E','C','A','R','M','E','N','Ã','A','P','U','A','I','P','N','D','U','A','H'},
			    {'E','F','E','S','I','M','A','N','S','E','N','I','A','D','J','U','A','N','F','A','J','P','A','P','A','U','L','A','T','A'},
			    {'N','A','H','E','S','P','I','E','K','A','A','N','A','U','J','A','N','A','C','U','A','S','O','R','A','E','J','U','F','E'},
			    {'K','O','L','N','A','K','E','U','I','N','O','N','A','V','N','L','A','A','N','A','D','P','T','S','R','O','S','U','F','S'},
			    {'N','T','A','E','A','S','P','A','P','A','A','A','O','A','R','A','B','E','P','R','A','O','O','E','R','A','T','O','A','O'},
			    {'E','S','O','J','A','I','E','E','N','P','E','S','O','J','E','O','R','A','E','T','O','R','A','N','T','A','A','B','E','J'},
			    {'J','A','F','E','Ã','O','P','N','P','A','U','J','O','G','J','N','P','E','A','U','P','H','A','N','E','J','U','A','N','K'},
				{'O','G','A','D','F','A','A','A','I','E','U','H','I','O','P','S','D','H','A','A','P','A','P','A','J','S','A','E','T','E'},
				{'M','A','N','J','U','A','N','I','P','A','T','O','S','D','P','U','E','E','P','D','A','S','U','N','P','U','R','E','N','A'},
				{'Q','U','I','T','A','R','E','N','S','A','P','E','N','A','U','J','P','N','O','T','E','R','P','A','A','A','A','F','L','I'},
				{'F','A','D','E','R','O','T','I','J','U','A','N','P','A','P','U','L','C','I','S','A','R','E','A','A','A','D','N','S','T'}};

    public void buscan(boolean siono){
        JUANB.setVisible(siono);
        INESB.setVisible(siono);
        CARMENB.setVisible(siono);
        JOSEB.setVisible(siono);
        MARTAB.setVisible(siono);
        CARLOSB.setVisible(siono);
        FELIPEB.setVisible(siono);
        ANAB.setVisible(siono);
        PEPEB.setVisible(siono);
        ROSAB.setVisible(siono);
    }
    
    public void esperan(boolean siono){
        JUAN.setVisible(siono);
        INES.setVisible(siono);
        CARMEN.setVisible(siono);
        JOSE.setVisible(siono);
        MARTA.setVisible(siono);
        CARLOS.setVisible(siono);
        FELIPE.setVisible(siono);
        ANA.setVisible(siono);
        PEPE.setVisible(siono);
        ROSA.setVisible(siono);
    }
    
    private void lupas(boolean siono){
        JUANL.setVisible(siono);
        INESL.setVisible(siono);
        CARMENL.setVisible(siono);
        JOSEL.setVisible(siono);
        MARTAL.setVisible(siono);
        CARLOSL.setVisible(siono);
        FELIPEL.setVisible(siono);
        ANAL.setVisible(siono);
        PEPEL.setVisible(siono);
        ROSAL.setVisible(siono);
    }

    private void corren(boolean siono){
        JUANC.setVisible(siono);
        INESC.setVisible(siono);
        CARMENC.setVisible(siono);
        JOSEC.setVisible(siono);
        MARTAC.setVisible(siono);
        CARLOSC.setVisible(siono);
        FELIPEC.setVisible(siono);
        ANAC.setVisible(siono);
        PEPEC.setVisible(siono);
        ROSAC.setVisible(siono);
    }

    private PrincipalView pri;
    Servidor server;

    /** Creates new form ServidorIniciado */
    public ServidorIniciado(PrincipalView p, Servidor s) {
        server = s;
        pri = p;
        initComponents();
        buscan(false);
        lupas(false);
        corren(false);
    }

    public void EjecutarMetodo(String metodo) throws ClassNotFoundException, NoSuchMethodException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException{
        //(String nombre, int porcentaje)
        Class clazz = this.getClass();
        Method method = clazz.getMethod(metodo);
        method.invoke(this);
    }

    public void buscoJUAN(){
        JUANB.setVisible(true);
        JUAN.setVisible(false);
        JUANL.setVisible(true);
    }

    public void buscoINES(){
        INESB.setVisible(true);
        INES.setVisible(false);
        INESL.setVisible(true);
    }

    public void buscoCARMEN(){
        CARMENB.setVisible(true);
        CARMEN.setVisible(false);
        CARMENL.setVisible(true);
    }

    public void buscoJOSE(){
        JOSEB.setVisible(true);
        JOSE.setVisible(false);
        JOSEL.setVisible(true);
    }

    public void buscoMARTA(){
        MARTAB.setVisible(true);
        MARTA.setVisible(false);
        MARTAL.setVisible(true);
    }

    public void buscoCARLOS(){
        CARLOSB.setVisible(true);
        CARLOS.setVisible(false);
        CARLOSL.setVisible(true);
    }

    public void buscoFELIPE(){
        FELIPEB.setVisible(true);
        FELIPE.setVisible(false);
        FELIPEL.setVisible(true);
    }

    public void buscoANA(){
        ANAB.setVisible(true);
        ANA.setVisible(false);
        ANAL.setVisible(true);
    }

    public void buscoPEPE(){
        PEPEB.setVisible(true);
        PEPE.setVisible(false);
        PEPEL.setVisible(true);
    }

    public void buscoROSA(){
        ROSAB.setVisible(true);
        ROSA.setVisible(false);
        ROSAL.setVisible(true);
    }

    public void envioJUAN(){
        JUANC.setVisible(true);
        JUANB.setVisible(false);
        JUANL.setVisible(false);
    }

    public void envioINES(){
        INESC.setVisible(true);
        INESB.setVisible(false);
        INESL.setVisible(false);
    }

    public void envioCARMEN(){
        CARMENC.setVisible(true);
        CARMENB.setVisible(false);
        CARMENL.setVisible(false);
    }

    public void envioJOSE(){
        JOSEC.setVisible(true);
        JOSEB.setVisible(false);
        JOSEL.setVisible(false);
    }

    public void envioMARTA(){
        MARTAC.setVisible(true);
        MARTAB.setVisible(false);
        MARTAL.setVisible(false);
    }

    public void envioCARLOS(){
        CARLOSC.setVisible(true);
        CARLOSB.setVisible(false);
        CARLOSL.setVisible(false);
    }

    public void envioFELIPE(){
        FELIPEC.setVisible(true);
        FELIPEB.setVisible(false);
        FELIPEL.setVisible(false);
    }

    public void envioANA(){
        ANAC.setVisible(true);
        ANAB.setVisible(false);
        ANAL.setVisible(false);
    }

    public void envioPEPE(){
        PEPEC.setVisible(true);
        PEPEB.setVisible(false);
        PEPEL.setVisible(false);
    }

    public void envioROSA(){
        ROSAC.setVisible(true);
        ROSAB.setVisible(false);
        ROSAL.setVisible(false);
    }

    public void EjecutarMetodo(String metodo, int entero) throws ClassNotFoundException, NoSuchMethodException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException{
        //(String nombre, int porcentaje)
        Class clazz = this.getClass();
        Method method = clazz.getMethod(metodo, int.class);
        method.invoke(this,entero);
    }

    public void setPorcentajeJUAN(int porcentaje){
        String p = "";
        p = String.format("%3s%c", Integer.toString(porcentaje), '%');
        JUANL.setText(p);
    }

    public void setPorcentajeINES(int porcentaje){
        String p = "";
        p = String.format("%3s%c", Integer.toString(porcentaje), '%');
        INESL.setText(p);
    }

    public void setPorcentajeCARMEN(int porcentaje){
        String p = "";
        p = String.format("%3s%c", Integer.toString(porcentaje), '%');
        CARMENL.setText(p);
    }

    public void setPorcentajeJOSE(int porcentaje){
        String p = "";
        p = String.format("%3s%c", Integer.toString(porcentaje), '%');
        JOSEL.setText(p);
    }

    public void setPorcentajeMARTA(int porcentaje){
        String p = "";
        p = String.format("%3s%c", Integer.toString(porcentaje), '%');
        MARTAL.setText(p);
    }

    public void setPorcentajeCARLOS(int porcentaje){
        String p = "";
        p = String.format("%3s%c", Integer.toString(porcentaje), '%');
        CARLOSL.setText(p);
    }

    public void setPorcentajeFELIPE(int porcentaje){
        String p = "";
        p = String.format("%3s%c", Integer.toString(porcentaje), '%');
        FELIPEL.setText(p);
    }

    public void setPorcentajeANA(int porcentaje){
        String p = "";
        p = String.format("%3s%c", Integer.toString(porcentaje), '%');
        ANAL.setText(p);
    }

    public void setPorcentajePEPE(int porcentaje){
        String p = "";
        p = String.format("%3s%c", Integer.toString(porcentaje), '%');
        PEPEL.setText(p);
    }

    public void setPorcentajeROSA(int porcentaje){
        String p = "";
        p = String.format("%3s%c", Integer.toString(porcentaje), '%');
        ROSAL.setText(p);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTabbedPane1 = new javax.swing.JTabbedPane();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLayeredPane14 = new javax.swing.JLayeredPane();
        jLayeredPane1 = new javax.swing.JLayeredPane();
        Iniciar = new javax.swing.JButton();
        jLayeredPane7 = new javax.swing.JLayeredPane();
        jLayeredPane2 = new javax.swing.JLayeredPane();
        CARMENL = new javax.swing.JLabel();
        CARMENC = new javax.swing.JLabel();
        CARMENB = new javax.swing.JLabel();
        CARMEN = new javax.swing.JLabel();
        jLayeredPane3 = new javax.swing.JLayeredPane();
        JUANL = new javax.swing.JLabel();
        JUANC = new javax.swing.JLabel();
        JUANB = new javax.swing.JLabel();
        JUAN = new javax.swing.JLabel();
        jLayeredPane4 = new javax.swing.JLayeredPane();
        INESL = new javax.swing.JLabel();
        INESC = new javax.swing.JLabel();
        INESB = new javax.swing.JLabel();
        INES = new javax.swing.JLabel();
        jLayeredPane5 = new javax.swing.JLayeredPane();
        MARTAL = new javax.swing.JLabel();
        MARTAC = new javax.swing.JLabel();
        MARTAB = new javax.swing.JLabel();
        MARTA = new javax.swing.JLabel();
        jLayeredPane6 = new javax.swing.JLayeredPane();
        CARLOSL = new javax.swing.JLabel();
        CARLOSC = new javax.swing.JLabel();
        CARLOSB = new javax.swing.JLabel();
        CARLOS = new javax.swing.JLabel();
        jLayeredPane8 = new javax.swing.JLayeredPane();
        jLayeredPane9 = new javax.swing.JLayeredPane();
        FELIPEL = new javax.swing.JLabel();
        FELIPEC = new javax.swing.JLabel();
        FELIPEB = new javax.swing.JLabel();
        FELIPE = new javax.swing.JLabel();
        jLayeredPane10 = new javax.swing.JLayeredPane();
        ANAL = new javax.swing.JLabel();
        ANAC = new javax.swing.JLabel();
        ANAB = new javax.swing.JLabel();
        ANA = new javax.swing.JLabel();
        jLayeredPane11 = new javax.swing.JLayeredPane();
        PEPEL = new javax.swing.JLabel();
        PEPEC = new javax.swing.JLabel();
        PEPEB = new javax.swing.JLabel();
        PEPE = new javax.swing.JLabel();
        jLayeredPane12 = new javax.swing.JLayeredPane();
        ROSAL = new javax.swing.JLabel();
        ROSAC = new javax.swing.JLabel();
        ROSAB = new javax.swing.JLabel();
        ROSA = new javax.swing.JLabel();
        jLayeredPane13 = new javax.swing.JLayeredPane();
        JOSEL = new javax.swing.JLabel();
        JOSEC = new javax.swing.JLabel();
        JOSEB = new javax.swing.JLabel();
        JOSE = new javax.swing.JLabel();
        jLayeredPane15 = new javax.swing.JLayeredPane();
        Terminar = new javax.swing.JButton();

        jTabbedPane1.setName("jTabbedPane1"); // NOI18N

        setMaximumSize(new java.awt.Dimension(360, 230));
        setMinimumSize(new java.awt.Dimension(360, 230));
        setPreferredSize(new java.awt.Dimension(360, 230));

        jLabel2.setName("jLabel2"); // NOI18N

        jLabel3.setName("jLabel3"); // NOI18N

        jLabel4.setName("jLabel4"); // NOI18N

        jLabel5.setName("jLabel5"); // NOI18N

        jLabel6.setName("jLabel6"); // NOI18N

        jLabel7.setName("jLabel7"); // NOI18N

        jLabel8.setName("jLabel8"); // NOI18N

        jLabel9.setName("jLabel9"); // NOI18N

        jLabel10.setName("jLabel10"); // NOI18N

        jLayeredPane14.setAutoscrolls(true);
        jLayeredPane14.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jLayeredPane14.setName("jLayeredPane14"); // NOI18N

        jLayeredPane1.setName("jLayeredPane1"); // NOI18N

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(principal.PrincipalApp.class).getContext().getResourceMap(ServidorIniciado.class);
        Iniciar.setText(resourceMap.getString("Iniciar.text")); // NOI18N
        Iniciar.setName("Iniciar"); // NOI18N
        Iniciar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                IniciarActionPerformed(evt);
            }
        });
        Iniciar.setBounds(30, 0, 120, 20);
        jLayeredPane1.add(Iniciar, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLayeredPane1.setBounds(10, 210, 160, 20);
        jLayeredPane14.add(jLayeredPane1, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLayeredPane7.setName("jLayeredPane7"); // NOI18N

        jLayeredPane2.setName("jLayeredPane2"); // NOI18N

        CARMENL.setFont(resourceMap.getFont("CARMENL.font")); // NOI18N
        CARMENL.setIcon(resourceMap.getIcon("CARMENL.icon")); // NOI18N
        CARMENL.setText(resourceMap.getString("CARMENL.text")); // NOI18N
        CARMENL.setName("CARMENL"); // NOI18N
        CARMENL.setBounds(90, 0, 64, 32);
        jLayeredPane2.add(CARMENL, javax.swing.JLayeredPane.DEFAULT_LAYER);

        CARMENC.setIcon(resourceMap.getIcon("CARMENC.icon")); // NOI18N
        CARMENC.setText(resourceMap.getString("CARMENC.text")); // NOI18N
        CARMENC.setName("CARMENC"); // NOI18N
        CARMENC.setBounds(0, 0, 78, 32);
        jLayeredPane2.add(CARMENC, javax.swing.JLayeredPane.DEFAULT_LAYER);

        CARMENB.setIcon(resourceMap.getIcon("CARMENB.icon")); // NOI18N
        CARMENB.setText(resourceMap.getString("CARMENB.text")); // NOI18N
        CARMENB.setName("CARMENB"); // NOI18N
        CARMENB.setBounds(0, 0, 80, 32);
        jLayeredPane2.add(CARMENB, javax.swing.JLayeredPane.DEFAULT_LAYER);

        CARMEN.setIcon(resourceMap.getIcon("CARMEN.icon")); // NOI18N
        CARMEN.setText(resourceMap.getString("CARMEN.text")); // NOI18N
        CARMEN.setName("CARMEN"); // NOI18N
        CARMEN.setBounds(0, 0, 78, 32);
        jLayeredPane2.add(CARMEN, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLayeredPane2.setBounds(0, 10, 160, 40);
        jLayeredPane7.add(jLayeredPane2, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLayeredPane3.setName("jLayeredPane3"); // NOI18N

        JUANL.setFont(resourceMap.getFont("JUANL.font")); // NOI18N
        JUANL.setIcon(resourceMap.getIcon("JUANL.icon")); // NOI18N
        JUANL.setText(resourceMap.getString("JUANL.text")); // NOI18N
        JUANL.setName("JUANL"); // NOI18N
        JUANL.setBounds(90, 0, 64, 32);
        jLayeredPane3.add(JUANL, javax.swing.JLayeredPane.DEFAULT_LAYER);

        JUANC.setIcon(resourceMap.getIcon("JUANC.icon")); // NOI18N
        JUANC.setText(resourceMap.getString("JUANC.text")); // NOI18N
        JUANC.setName("JUANC"); // NOI18N
        JUANC.setBounds(0, 0, 62, 32);
        jLayeredPane3.add(JUANC, javax.swing.JLayeredPane.DEFAULT_LAYER);

        JUANB.setIcon(resourceMap.getIcon("JUANB.icon")); // NOI18N
        JUANB.setText(resourceMap.getString("JUANB.text")); // NOI18N
        JUANB.setName("JUANB"); // NOI18N
        JUANB.setBounds(0, 0, 62, 32);
        jLayeredPane3.add(JUANB, javax.swing.JLayeredPane.DEFAULT_LAYER);

        JUAN.setIcon(resourceMap.getIcon("JUAN.icon")); // NOI18N
        JUAN.setText(resourceMap.getString("JUAN.text")); // NOI18N
        JUAN.setName("JUAN"); // NOI18N
        JUAN.setBounds(0, 0, 62, 32);
        jLayeredPane3.add(JUAN, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLayeredPane3.setBounds(0, 50, 160, 40);
        jLayeredPane7.add(jLayeredPane3, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLayeredPane4.setName("jLayeredPane4"); // NOI18N

        INESL.setFont(resourceMap.getFont("INESL.font")); // NOI18N
        INESL.setIcon(resourceMap.getIcon("INESL.icon")); // NOI18N
        INESL.setText(resourceMap.getString("INESL.text")); // NOI18N
        INESL.setName("INESL"); // NOI18N
        INESL.setBounds(90, 0, 64, 32);
        jLayeredPane4.add(INESL, javax.swing.JLayeredPane.DEFAULT_LAYER);

        INESC.setIcon(resourceMap.getIcon("INESC.icon")); // NOI18N
        INESC.setText(resourceMap.getString("INESC.text")); // NOI18N
        INESC.setName("INESC"); // NOI18N
        INESC.setBounds(0, 0, 59, 32);
        jLayeredPane4.add(INESC, javax.swing.JLayeredPane.DEFAULT_LAYER);

        INESB.setIcon(resourceMap.getIcon("INESB.icon")); // NOI18N
        INESB.setText(resourceMap.getString("INESB.text")); // NOI18N
        INESB.setName("INESB"); // NOI18N
        INESB.setBounds(0, 0, 59, 32);
        jLayeredPane4.add(INESB, javax.swing.JLayeredPane.DEFAULT_LAYER);

        INES.setIcon(resourceMap.getIcon("INES.icon")); // NOI18N
        INES.setText(resourceMap.getString("INES.text")); // NOI18N
        INES.setName("INES"); // NOI18N
        INES.setBounds(0, 0, 59, 32);
        jLayeredPane4.add(INES, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLayeredPane4.setBounds(0, 90, 160, 40);
        jLayeredPane7.add(jLayeredPane4, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLayeredPane5.setName("jLayeredPane5"); // NOI18N

        MARTAL.setFont(resourceMap.getFont("MARTAL.font")); // NOI18N
        MARTAL.setIcon(resourceMap.getIcon("MARTAL.icon")); // NOI18N
        MARTAL.setText(resourceMap.getString("MARTAL.text")); // NOI18N
        MARTAL.setName("MARTAL"); // NOI18N
        MARTAL.setBounds(90, 0, 64, 32);
        jLayeredPane5.add(MARTAL, javax.swing.JLayeredPane.DEFAULT_LAYER);

        MARTAC.setIcon(resourceMap.getIcon("MARTAC.icon")); // NOI18N
        MARTAC.setText(resourceMap.getString("MARTAC.text")); // NOI18N
        MARTAC.setName("MARTAC"); // NOI18N
        MARTAC.setBounds(0, 0, 71, 32);
        jLayeredPane5.add(MARTAC, javax.swing.JLayeredPane.DEFAULT_LAYER);

        MARTAB.setIcon(resourceMap.getIcon("MARTAB.icon")); // NOI18N
        MARTAB.setText(resourceMap.getString("MARTAB.text")); // NOI18N
        MARTAB.setName("MARTAB"); // NOI18N
        MARTAB.setBounds(0, 0, 71, 32);
        jLayeredPane5.add(MARTAB, javax.swing.JLayeredPane.DEFAULT_LAYER);

        MARTA.setIcon(resourceMap.getIcon("MARTA.icon")); // NOI18N
        MARTA.setText(resourceMap.getString("MARTA.text")); // NOI18N
        MARTA.setName("MARTA"); // NOI18N
        MARTA.setBounds(0, 0, 71, 32);
        jLayeredPane5.add(MARTA, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLayeredPane5.setBounds(0, 130, 160, 40);
        jLayeredPane7.add(jLayeredPane5, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLayeredPane6.setName("jLayeredPane6"); // NOI18N

        CARLOSL.setFont(resourceMap.getFont("MARTAL.font")); // NOI18N
        CARLOSL.setIcon(resourceMap.getIcon("CARLOSL.icon")); // NOI18N
        CARLOSL.setText(resourceMap.getString("CARLOSL.text")); // NOI18N
        CARLOSL.setName("CARLOSL"); // NOI18N
        CARLOSL.setBounds(90, 0, 64, 32);
        jLayeredPane6.add(CARLOSL, javax.swing.JLayeredPane.DEFAULT_LAYER);

        CARLOSC.setIcon(resourceMap.getIcon("CARLOSC.icon")); // NOI18N
        CARLOSC.setText(resourceMap.getString("CARLOSC.text")); // NOI18N
        CARLOSC.setName("CARLOSC"); // NOI18N
        CARLOSC.setBounds(0, 0, 76, 32);
        jLayeredPane6.add(CARLOSC, javax.swing.JLayeredPane.DEFAULT_LAYER);

        CARLOSB.setIcon(resourceMap.getIcon("CARLOSB.icon")); // NOI18N
        CARLOSB.setText(resourceMap.getString("CARLOSB.text")); // NOI18N
        CARLOSB.setName("CARLOSB"); // NOI18N
        CARLOSB.setBounds(0, 0, 76, 32);
        jLayeredPane6.add(CARLOSB, javax.swing.JLayeredPane.DEFAULT_LAYER);

        CARLOS.setIcon(resourceMap.getIcon("CARLOS.icon")); // NOI18N
        CARLOS.setText(resourceMap.getString("CARLOS.text")); // NOI18N
        CARLOS.setName("CARLOS"); // NOI18N
        CARLOS.setBounds(0, 0, 76, 32);
        jLayeredPane6.add(CARLOS, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLayeredPane6.setBounds(0, 170, 160, 40);
        jLayeredPane7.add(jLayeredPane6, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLayeredPane7.setBounds(10, 0, 160, 203);
        jLayeredPane14.add(jLayeredPane7, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLayeredPane8.setName("jLayeredPane8"); // NOI18N

        jLayeredPane9.setName("jLayeredPane9"); // NOI18N

        FELIPEL.setFont(resourceMap.getFont("MARTAL.font")); // NOI18N
        FELIPEL.setIcon(resourceMap.getIcon("FELIPEL.icon")); // NOI18N
        FELIPEL.setText(resourceMap.getString("FELIPEL.text")); // NOI18N
        FELIPEL.setName("FELIPEL"); // NOI18N
        FELIPEL.setBounds(90, 0, 64, 32);
        jLayeredPane9.add(FELIPEL, javax.swing.JLayeredPane.DEFAULT_LAYER);

        FELIPEC.setIcon(resourceMap.getIcon("FELIPEC.icon")); // NOI18N
        FELIPEC.setText(resourceMap.getString("FELIPEC.text")); // NOI18N
        FELIPEC.setName("FELIPEC"); // NOI18N
        FELIPEC.setBounds(0, 0, 69, 32);
        jLayeredPane9.add(FELIPEC, javax.swing.JLayeredPane.DEFAULT_LAYER);

        FELIPEB.setIcon(resourceMap.getIcon("FELIPEB.icon")); // NOI18N
        FELIPEB.setText(resourceMap.getString("FELIPEB.text")); // NOI18N
        FELIPEB.setName("FELIPEB"); // NOI18N
        FELIPEB.setBounds(0, 0, 69, 32);
        jLayeredPane9.add(FELIPEB, javax.swing.JLayeredPane.DEFAULT_LAYER);

        FELIPE.setIcon(resourceMap.getIcon("FELIPE.icon")); // NOI18N
        FELIPE.setText(resourceMap.getString("FELIPE.text")); // NOI18N
        FELIPE.setName("FELIPE"); // NOI18N
        FELIPE.setBounds(0, 0, 69, 32);
        jLayeredPane9.add(FELIPE, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLayeredPane9.setBounds(0, 10, 160, 40);
        jLayeredPane8.add(jLayeredPane9, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLayeredPane10.setName("jLayeredPane10"); // NOI18N

        ANAL.setFont(resourceMap.getFont("MARTAL.font")); // NOI18N
        ANAL.setIcon(resourceMap.getIcon("ANAL.icon")); // NOI18N
        ANAL.setText(resourceMap.getString("ANAL.text")); // NOI18N
        ANAL.setName("ANAL"); // NOI18N
        ANAL.setBounds(90, 0, 64, 32);
        jLayeredPane10.add(ANAL, javax.swing.JLayeredPane.DEFAULT_LAYER);

        ANAC.setIcon(resourceMap.getIcon("ANAC.icon")); // NOI18N
        ANAC.setText(resourceMap.getString("ANAC.text")); // NOI18N
        ANAC.setName("ANAC"); // NOI18N
        ANAC.setBounds(0, 0, 57, 32);
        jLayeredPane10.add(ANAC, javax.swing.JLayeredPane.DEFAULT_LAYER);

        ANAB.setIcon(resourceMap.getIcon("ANAB.icon")); // NOI18N
        ANAB.setText(resourceMap.getString("ANAB.text")); // NOI18N
        ANAB.setName("ANAB"); // NOI18N
        ANAB.setBounds(0, 0, 57, 32);
        jLayeredPane10.add(ANAB, javax.swing.JLayeredPane.DEFAULT_LAYER);

        ANA.setIcon(resourceMap.getIcon("ANA.icon")); // NOI18N
        ANA.setText(resourceMap.getString("ANA.text")); // NOI18N
        ANA.setName("ANA"); // NOI18N
        ANA.setBounds(0, 0, 57, 32);
        jLayeredPane10.add(ANA, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLayeredPane10.setBounds(0, 50, 160, 40);
        jLayeredPane8.add(jLayeredPane10, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLayeredPane11.setName("jLayeredPane11"); // NOI18N

        PEPEL.setFont(resourceMap.getFont("MARTAL.font")); // NOI18N
        PEPEL.setIcon(resourceMap.getIcon("PEPEL.icon")); // NOI18N
        PEPEL.setText(resourceMap.getString("PEPEL.text")); // NOI18N
        PEPEL.setName("PEPEL"); // NOI18N
        PEPEL.setBounds(90, 0, 64, 32);
        jLayeredPane11.add(PEPEL, javax.swing.JLayeredPane.DEFAULT_LAYER);

        PEPEC.setIcon(resourceMap.getIcon("PEPEC.icon")); // NOI18N
        PEPEC.setText(resourceMap.getString("PEPEC.text")); // NOI18N
        PEPEC.setName("PEPEC"); // NOI18N
        PEPEC.setBounds(0, 0, 60, 32);
        jLayeredPane11.add(PEPEC, javax.swing.JLayeredPane.DEFAULT_LAYER);

        PEPEB.setIcon(resourceMap.getIcon("PEPEB.icon")); // NOI18N
        PEPEB.setText(resourceMap.getString("PEPEB.text")); // NOI18N
        PEPEB.setName("PEPEB"); // NOI18N
        PEPEB.setBounds(0, 0, 60, 32);
        jLayeredPane11.add(PEPEB, javax.swing.JLayeredPane.DEFAULT_LAYER);

        PEPE.setIcon(resourceMap.getIcon("PEPE.icon")); // NOI18N
        PEPE.setText(resourceMap.getString("PEPE.text")); // NOI18N
        PEPE.setName("PEPE"); // NOI18N
        PEPE.setBounds(0, 0, 60, 32);
        jLayeredPane11.add(PEPE, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLayeredPane11.setBounds(0, 90, 160, 40);
        jLayeredPane8.add(jLayeredPane11, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLayeredPane12.setName("jLayeredPane12"); // NOI18N

        ROSAL.setFont(resourceMap.getFont("MARTAL.font")); // NOI18N
        ROSAL.setIcon(resourceMap.getIcon("ROSAL.icon")); // NOI18N
        ROSAL.setText(resourceMap.getString("ROSAL.text")); // NOI18N
        ROSAL.setName("ROSAL"); // NOI18N
        ROSAL.setBounds(90, 0, 64, 32);
        jLayeredPane12.add(ROSAL, javax.swing.JLayeredPane.DEFAULT_LAYER);

        ROSAC.setIcon(resourceMap.getIcon("ROSAC.icon")); // NOI18N
        ROSAC.setText(resourceMap.getString("ROSAC.text")); // NOI18N
        ROSAC.setName("ROSAC"); // NOI18N
        ROSAC.setBounds(0, 0, 64, 32);
        jLayeredPane12.add(ROSAC, javax.swing.JLayeredPane.DEFAULT_LAYER);

        ROSAB.setIcon(resourceMap.getIcon("ROSAB.icon")); // NOI18N
        ROSAB.setText(resourceMap.getString("ROSAB.text")); // NOI18N
        ROSAB.setName("ROSAB"); // NOI18N
        ROSAB.setBounds(0, 0, 64, 32);
        jLayeredPane12.add(ROSAB, javax.swing.JLayeredPane.DEFAULT_LAYER);

        ROSA.setIcon(resourceMap.getIcon("ROSA.icon")); // NOI18N
        ROSA.setText(resourceMap.getString("ROSA.text")); // NOI18N
        ROSA.setName("ROSA"); // NOI18N
        ROSA.setBounds(0, 0, 64, 32);
        jLayeredPane12.add(ROSA, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLayeredPane12.setBounds(0, 130, 160, 40);
        jLayeredPane8.add(jLayeredPane12, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLayeredPane13.setName("jLayeredPane13"); // NOI18N

        JOSEL.setFont(resourceMap.getFont("MARTAL.font")); // NOI18N
        JOSEL.setIcon(resourceMap.getIcon("JOSEL.icon")); // NOI18N
        JOSEL.setText(resourceMap.getString("JOSEL.text")); // NOI18N
        JOSEL.setName("JOSEL"); // NOI18N
        JOSEL.setBounds(90, 0, 64, 32);
        jLayeredPane13.add(JOSEL, javax.swing.JLayeredPane.DEFAULT_LAYER);

        JOSEC.setIcon(resourceMap.getIcon("JOSEC.icon")); // NOI18N
        JOSEC.setText(resourceMap.getString("JOSEC.text")); // NOI18N
        JOSEC.setName("JOSEC"); // NOI18N
        JOSEC.setBounds(0, 0, 61, 32);
        jLayeredPane13.add(JOSEC, javax.swing.JLayeredPane.DEFAULT_LAYER);

        JOSEB.setIcon(resourceMap.getIcon("JOSEB.icon")); // NOI18N
        JOSEB.setText(resourceMap.getString("JOSEB.text")); // NOI18N
        JOSEB.setName("JOSEB"); // NOI18N
        JOSEB.setBounds(0, 0, 61, 32);
        jLayeredPane13.add(JOSEB, javax.swing.JLayeredPane.DEFAULT_LAYER);

        JOSE.setIcon(resourceMap.getIcon("JOSE.icon")); // NOI18N
        JOSE.setText(resourceMap.getString("JOSE.text")); // NOI18N
        JOSE.setName("JOSE"); // NOI18N
        JOSE.setBounds(0, 0, 61, 32);
        jLayeredPane13.add(JOSE, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLayeredPane13.setBounds(0, 170, 160, 40);
        jLayeredPane8.add(jLayeredPane13, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLayeredPane8.setBounds(190, 0, 160, 210);
        jLayeredPane14.add(jLayeredPane8, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLayeredPane15.setName("jLayeredPane15"); // NOI18N

        Terminar.setText(resourceMap.getString("Terminar.text")); // NOI18N
        Terminar.setName("Terminar"); // NOI18N
        Terminar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                TerminarActionPerformed(evt);
            }
        });
        Terminar.setBounds(10, 0, 120, 20);
        jLayeredPane15.add(Terminar, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLayeredPane15.setBounds(190, 210, 160, 20);
        jLayeredPane14.add(jLayeredPane15, javax.swing.JLayeredPane.DEFAULT_LAYER);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLayeredPane14, javax.swing.GroupLayout.PREFERRED_SIZE, 360, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(233, 233, 233)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel6)
                            .addComponent(jLabel7)
                            .addComponent(jLabel8)
                            .addComponent(jLabel9)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(61, 61, 61)
                                .addComponent(jLabel10))))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel2)
                            .addComponent(jLabel4)
                            .addComponent(jLabel5)
                            .addComponent(jLabel3))))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLayeredPane14, javax.swing.GroupLayout.PREFERRED_SIZE, 230, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(51, 51, 51)
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel5))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel6)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel7)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel8)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel9)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel10)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void TerminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TerminarActionPerformed
        // TODO add your handling code here:
        //serv.salir();
        System.exit(0);
    }//GEN-LAST:event_TerminarActionPerformed

    private void IniciarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_IniciarActionPerformed
        // TODO add your handling code here:
        Obrero juan = new Obrero("JUAN",sopa,server,pri);
        juan.start();
        Obrero ines = new Obrero("INES",sopa,server,pri);
        ines.start();
        Obrero carmen = new Obrero("CARMEN",sopa,server,pri);
        carmen.start();
        Obrero jose = new Obrero("JOSE",sopa,server,pri);
        jose.start();
        Obrero marta = new Obrero("MARTA",sopa,server,pri);
        marta.start();
        Obrero carlos = new Obrero("CARLOS",sopa,server,pri);
        carlos.start();
        Obrero felipe = new Obrero("FELIPE",sopa,server,pri);
        felipe.start();
        Obrero ana = new Obrero("ANA",sopa,server,pri);
        ana.start();
        Obrero pepe = new Obrero("PEPE",sopa,server,pri);
        pepe.start();
        Obrero rosa = new Obrero("ROSA",sopa,server,pri);
        rosa.start();
    }//GEN-LAST:event_IniciarActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel ANA;
    private javax.swing.JLabel ANAB;
    private javax.swing.JLabel ANAC;
    private javax.swing.JLabel ANAL;
    private javax.swing.JLabel CARLOS;
    private javax.swing.JLabel CARLOSB;
    private javax.swing.JLabel CARLOSC;
    private javax.swing.JLabel CARLOSL;
    private javax.swing.JLabel CARMEN;
    private javax.swing.JLabel CARMENB;
    private javax.swing.JLabel CARMENC;
    private javax.swing.JLabel CARMENL;
    private javax.swing.JLabel FELIPE;
    private javax.swing.JLabel FELIPEB;
    private javax.swing.JLabel FELIPEC;
    private javax.swing.JLabel FELIPEL;
    private javax.swing.JLabel INES;
    private javax.swing.JLabel INESB;
    private javax.swing.JLabel INESC;
    private javax.swing.JLabel INESL;
    private javax.swing.JButton Iniciar;
    private javax.swing.JLabel JOSE;
    private javax.swing.JLabel JOSEB;
    private javax.swing.JLabel JOSEC;
    private javax.swing.JLabel JOSEL;
    private javax.swing.JLabel JUAN;
    private javax.swing.JLabel JUANB;
    private javax.swing.JLabel JUANC;
    private javax.swing.JLabel JUANL;
    private javax.swing.JLabel MARTA;
    private javax.swing.JLabel MARTAB;
    private javax.swing.JLabel MARTAC;
    private javax.swing.JLabel MARTAL;
    private javax.swing.JLabel PEPE;
    private javax.swing.JLabel PEPEB;
    private javax.swing.JLabel PEPEC;
    private javax.swing.JLabel PEPEL;
    private javax.swing.JLabel ROSA;
    private javax.swing.JLabel ROSAB;
    private javax.swing.JLabel ROSAC;
    private javax.swing.JLabel ROSAL;
    private javax.swing.JButton Terminar;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JLayeredPane jLayeredPane1;
    private javax.swing.JLayeredPane jLayeredPane10;
    private javax.swing.JLayeredPane jLayeredPane11;
    private javax.swing.JLayeredPane jLayeredPane12;
    private javax.swing.JLayeredPane jLayeredPane13;
    private javax.swing.JLayeredPane jLayeredPane14;
    private javax.swing.JLayeredPane jLayeredPane15;
    private javax.swing.JLayeredPane jLayeredPane2;
    private javax.swing.JLayeredPane jLayeredPane3;
    private javax.swing.JLayeredPane jLayeredPane4;
    private javax.swing.JLayeredPane jLayeredPane5;
    private javax.swing.JLayeredPane jLayeredPane6;
    private javax.swing.JLayeredPane jLayeredPane7;
    private javax.swing.JLayeredPane jLayeredPane8;
    private javax.swing.JLayeredPane jLayeredPane9;
    private javax.swing.JTabbedPane jTabbedPane1;
    // End of variables declaration//GEN-END:variables

}
